class Solution {
public:

    void _haota(vector<int>& A, vector<int>& B, vector<int>& C, int n)
    {
        if (n == 1)
        {
            C.push_back(A.back());
            A.pop_back();
            return;
        }
        _haota(A, C, B, n - 1);
        C.push_back(A.back());
        A.pop_back();
        _haota(B, A, C, n - 1);

    }


    void hanota(vector<int>& A, vector<int>& B, vector<int>& C)
    {
        return _haota(A, B, C, A.size());

    }
};